﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Xna.Framework;
using Newtonsoft.Json;
using YacME.Map;
using YacME.Script;
using Keys = Microsoft.Xna.Framework.Input.Keys;

namespace YacME
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            var mapObject = new MapObject
                                {
                                    Position = new Vector2(0, 0),
                                    Size = new Vector2(0, 0),
                                    Velocity = new Vector2(0, 0),
                                    ObjectName = "object1",
                                    RenderImageLocation = null,
                                    Properties = new Dictionary<string, object>(),
                                    EventRecognitionFunctionNameList = new Dictionary<string, string>(),
                                    EventFunctionNameList = new Dictionary<string, List<string>>(),
                                    UpdateFunctionNameList = new List<string>(),
                                    InputFunctionNameList = new Dictionary<Keys, List<string>>()
                                };

            mapObject.InputFunctionNameList.Add(Keys.Up, new List<string>());
            mapObject.InputFunctionNameList[Keys.Up].Add("testfunction");

            //var scriptLoadingHelper = new ScriptLoadingHelper
            //                              {
            //                                  FunctionNameList = new string[] {},
            //                                  PythonSource = "import clr" + Environment.NewLine
            //                              };

            textBox1.Text = JsonConvert.SerializeObject(mapObject, Formatting.Indented);
        }
    }
}
